/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.lcfgly.Database;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author lcfgly
 */
@Entity
@Table(name = "message0")
@NamedQueries({
    @NamedQuery(name = "Message.findAll", query = "SELECT m FROM Message m")})
public class Message implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @Column(name = "uptime")
    @Temporal(TemporalType.DATE)
    private Date uptime;
    @Basic(optional = false)
    @Column(name = "comeid")
    private int comeid;
    @Basic(optional = false)
    @Column(name = "goid")
    private int goid;
    @Basic(optional = false)
    @Column(name = "message")
    private String message;
    @Column(name = "back")
    private String back;
    @Basic(optional = false)
    @Column(name = "opend")
    private boolean opend;
    @Basic(optional = false)
    @Column(name = "backtime")
    @Temporal(TemporalType.DATE)
    private Date backtime;

    public Message() {
    }

    public Message(Integer id) {
        this.id = id;
    }

    public Message(Integer id, Date uptime, int comeid, int goid, String message, boolean opend) {
        this.id = id;
        this.uptime = uptime;
        this.comeid = comeid;
        this.goid = goid;
        this.message = message;
        this.opend = opend;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Date getUptime() {
        return uptime;
    }

    public void setUptime(Date uptime) {
        this.uptime = uptime;
    }

    public int getComeid() {
        return comeid;
    }

    public void setComeid(int comeid) {
        this.comeid = comeid;
    }

    public int getGoid() {
        return goid;
    }

    public void setGoid(int goid) {
        this.goid = goid;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getBack() {
        return back;
    }

    public void setBack(String back) {
        this.back = back;
    }

    public boolean getOpend() {
        return opend;
    }

    public void setOpend(boolean opend) {
        this.opend = opend;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Message)) {
            return false;
        }
        Message other = (Message) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.lcfgly.Database.Message[ id=" + id + " ]";
    }
    
    public Date getBacktime() {
        return backtime;
    }

    public void setBacktime(Date backtime) {
        this.backtime = backtime;
    }
    
}
